Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use context manager when creating temporary directory #12559

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

fridex
Copy link
Contributor

@fridex fridex commented Jul 21, 2022

What does this PR do?

With this change, the temporary directory will be removed if there would be any
exception within the with block. The temporary directory would be
properly removed on any error raised.

…ks-downloader

With this change, the temporary directory will be removed if there would be any
exception within the with block. The temporary directory would be
properly removed on any error raised.
@fridex fridex requested a review from a team as a code owner July 21, 2022 08:07
Copy link
Member

@FlorentClarret FlorentClarret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@FlorentClarret FlorentClarret merged commit 675fe0d into DataDog:master Aug 1, 2022
@fridex fridex deleted the context-manager-tmpdir branch August 1, 2022 10:31
FlorentClarret added a commit that referenced this pull request Aug 1, 2022
FlorentClarret added a commit that referenced this pull request Aug 1, 2022
* Revert "Use context manager when creating temporary directory in datadog-checks-downloader (#12559)"

This reverts commit 675fe0d.

* Make sure the tempdir is removed in case an exception is raised
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants